package com.cmsky.open.shop.manager;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

import com.cmsky.open.core.base.*;
import com.cmsky.open.core.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.cmsky.open.shop.model.*;
import com.cmsky.open.shop.dao.*;
import com.cmsky.open.shop.manager.*;
import com.cmsky.open.shop.vo.query.*;

/**
 * @author jandyfish email:jandyfish(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


@Service
@Transactional
public class ShopInfoManager extends BaseManager<ShopInfo,java.lang.Integer>{

	private ShopInfoDao shopInfoDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	public void setShopInfoDao(ShopInfoDao dao) {
		this.shopInfoDao = dao;
	}
	public EntityDao getEntityDao() {
		return this.shopInfoDao;
	}
	
	public int saveOrUpdate(ShopInfo entity) {
		if(entity.getId()==null || entity.getId()<=0) 
			return save(entity);
		else 
			return update(entity);
	}
	
	@Transactional(readOnly=true)
	public BasePager findPage(String statementName,ShopInfoQuery query) {
		return shopInfoDao.findPage(statementName,query);
	}
	
	public int updatePass(ShopInfoQuery query){
		return this.shopInfoDao.updatePass(query);
	}
}
